<?php

function checkFormularz($zmienne, $ColToIgnore = "")
{
    foreach($zmienne as $klucz => $wartosc)
    {
		if ($klucz != $ColToIgnore)
		{
			if (strlen($wartosc) == 0 || !isset($klucz))// || (ereg('[a-z]*[0-9]*[a-z]*', $wartosc)))
			{
				return false;
			}
		}   
    }
    return true;
}

function checkEmail($email)
{
    include_once ('classes/functionDb.php');
    $lacz  = ConnectUser();
    $wynik = $lacz -> query ('SELECT email FROM users WHERE email = \'' . addslashes($email) . '\' ');
	mysqli_close($lacz);
	if ($wynik){
		if ($wynik -> num_rows > 0)
		{
			return false;
		}			
	} else {
		return false;
	}
    return true;
}

function checkUserLogin($userLogin)
{
    include_once('classes/functionDb.php');
    $lacz  = ConnectUser();
    $wynik = $lacz -> query('SELECT * FROM cad_klienci WHERE klientLogin = \'' . addslashes($userLogin) . '\' ');
	mysqli_close($lacz);
	if ($wynik -> num_rows > 0)
	{
		return false;
	}
    return true;
}
?>